<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@include file="/WEB-INF/pages/common/common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
    <%@include file="/resources/datepicker/datepicker.jsp"%>
    <title><spring:message code="title.part"/></title>
    <script type="text/javascript">
        var datagrid;
        var message =$.messager;
        var operateDialog;

        $(function() {
            datagrid=$('#datagrid').datagrid({
                pageSize:20,
                pageList:[20],
                url : '${path}/business/ipic_system/pmcp/ajaxTabTwoList.do',
                onLoadSuccess:function(){
                    datagrid.datagrid('clearSelections');
                },
                queryParams: imonJYRH.serializeObject($("#tableForm *")),
                onBeforeLoad:function(){
                    if($('#supplierId').val()==''){
                        message.alert('<spring:message code='msg.tip'/>','请选择供应商！');
                        return false;
                    }
                }
            });
        });
        function search_() {
            datagrid.datagrid('unselectAll');
            datagrid.datagrid('load', imonJYRH.serializeObject($("#tableForm *")));
        }
        function dialogSupplier_(){
            var href = '${path}/basedata/supplier/dialogUI.do';
            operateDialog = $("#operateDialog").dialog({
                title : '<spring:message code='msg.dialog.choose'/>',
                width : 650,
                height : 400
            });
            $("#operateIFrame")[0].src=href;
            operateDialog.dialog('open');
        }
        function dialogSupplierReturn(row){
            $("#supplierId").val(row['id']);
            $("#supplierCode").val(row['code']);
            $("#supplierName").val(row['name']);
            operateDialog.dialog('close');
        }
    </script>
</head>
<body class="easyui-layout">
<div data-options="region:'north'" style="overflow: hidden;height: 55px;">
    <div class="datagrid-toolbar" style="height: auto">
        <fieldset>
            <legend><spring:message code="label.condition"/></legend>
            <table id="tableForm" width="100%">
                <tr>
                    <td align="right"><spring:message code="label.year"/>：</td>
                    <td>
                        <input type="text" name="year" value="${entity.year}"
                               onFocus="WdatePicker({isShowClear:false,isShowToday:false,dateFmt:'yyyy',readOnly:true})" class="Wdate"/>
                    </td>
                    <td align="right"><spring:message code="label.supplier.code"/>：</td>
                    <td>
                        <input type="hidden" id='supplierId' name="supplierId"/>
                        <input type="text" id="supplierCode" onclick="dialogSupplier_();" readonly="true"/>
                    </td>
                    <td align="right"><spring:message code='label.supplier.name'/>:</td>
                    <td align="left">
                        <input type="text" id="supplierName" style="width: 180px;" disabled/>
                    </td>
                </tr>
            </table>
        </fieldset>
    </div>
</div>
<div data-options="region:'center'">
    <div id="tb">
        <a class="easyui-linkbutton" href="javascript:void(0);" plain="true" iconCls="icon-search" onclick="search_();"><spring:message code="bar.command.search"/></a>
    </div>
    <table id="datagrid" width="100%"
           data-options="toolbar:'#tb',striped:true,fit:true,pagination:true,idField:'id',rownumbers:true,nowrap:false">
        <thead data-options="frozen:true">
        <tr>
            <%--<th data-options="align:'center',width:'40',field:'year'" rowspan="2"><spring:message code="table.head.year"/></th>--%>
            <th data-options="align:'center',width:'40',field:'month'" rowspan="2"><spring:message code="table.head.month"/></th>
            <%--<th data-options="align:'center',width:'80',field:'supplierCode'" rowspan="2"><spring:message code="table.head.supplier.code"/></th>--%>
            <%--<th data-options="align:'center',width:'120',field:'supplierName'" rowspan="2"><spring:message code="table.head.supplier.name"/></th>--%>
        </tr>
        </thead>
        <thead>
        <tr>
            <th align="center" colspan="4"><spring:message code="table.head.ipic.month.data"/></th>
            <th align="center" colspan="4"><spring:message code="table.head.ipic.ipic.data"/></th>
            <th data-options="align:'center',width:'100',field:'targetIpicAverageYear'" rowspan="2"><spring:message code="table.head.ipic.target.ipic.average.year"/></th>
            <th data-options="align:'center',width:'100',field:'claimAccumulate'" rowspan="2"><spring:message code="table.head.ipic.claim.accumulate"/></th>
        </tr>
        <tr>
            <th data-options="align:'center',width:'90',field:'ppm'"><spring:message code="table.head.ipic.ppm"/></th>
            <th data-options="align:'center',width:'110',field:'valueP'"><spring:message code="table.head.ipic.value.p"/></th>
            <th data-options="align:'center',width:'80',field:'claimQuantity'"><spring:message code="table.head.ipic.claim.quantity"/></th>
            <th data-options="align:'center',width:'70',field:'valueC'"><spring:message code="table.head.ipic.value.c"/></th>

            <th data-options="align:'center',width:'90',field:'ipicMonth'"><spring:message code="table.head.ipic.month"/></th>
            <th data-options="align:'center',width:'110',field:'ipicAccumulate'"><spring:message code="table.head.ipic.accumulate"/></th>
            <th data-options="align:'center',width:'80',field:'ipicRolling'"><spring:message code="table.head.ipic.rolling"/></th>
            <th data-options="align:'center',width:'100',field:'ipicAverageAccumulate'"><spring:message code="table.head.ipic.average.accumulate"/></th>

        </tr>
        </thead>
    </table>
</div>
<div id="operateDialog" class="easyui-dialog"
     data-options="iconCls:'icon-save',resizable:true,modal:true,closed: true,collapsible:true,maximizable:true">
    <iframe scrolling="auto" id='operateIFrame' frameborder="0"  src="" style="width:100%;height:100%;"/>
</div>
</body>
</html>